package hig.no.group;

import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.SimpleCursorAdapter;

public class ListSettings extends ListActivity {

	private DBAdapter mDBHelper;
	private Cursor mC;

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.main);
   
        mDBHelper = new DBAdapter(this);
        mDBHelper = mDBHelper.open();   
        
        refreshList();

    }
	
	
	private void refreshList() {
		
		mC = mDBHelper.GetAllGPSlocations();
		System.out.println("EVERY GPS's ARE GET ?");
		startManagingCursor(mC);
		System.out.println("CURSOR STARTED ?");
		
		SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.row, mC, new String[] {DBAdapter.COL_LATITUDE, DBAdapter.COL_LONGITUDE, DBAdapter.COL_STREET}, new int[] {R.id.txtText1, R.id.txtText2, R.id.txtText3});
		setListAdapter(adapter);
	}

	
	
}
